/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.googlecode.mindlistening.freemind;

import com.googlecode.mindlistening.PropertiesStorage;
import freemind.controller.Controller;
import freemind.modes.mindmapmode.MindMapController;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author ryan
 */
public class FreeMindPropertiesStorage implements  PropertiesStorage {
    Controller controller;
    
    public FreeMindPropertiesStorage(MindMapController mm_controller) {
            this.controller = mm_controller.getController();
    }
    public void storeProperty(String property, String value) {
                    controller.setProperty(property,value);
    }
    public String loadProperty(String property){
            return controller.getProperty(property);
    }
    public void showURL(String url) {
        try {
            controller.getFrame().openDocument(new java.net.URL(url));
        } catch (Exception ex) {
            Logger.getLogger(FreeMindPropertiesStorage.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
